package com.unit2;

import java.util.Scanner;

/**
 * @author Siaze
 * @description 编程生产一个N阶矩阵，使其主对角线相邻上元素皆为1，与其主对角线左侧相邻元素皆为2，其余元素为0.
 * @date 2021/11/2
 */
public class Two {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int length = scanner.nextInt();
        for (int i = 0; i < length; i++) {
            for (int j = 0; j < length; j++) {
                if (i == j){
                    System.out.print(1);
                }else if (i > j){
                    System.out.print(2);
                }else {
                    System.out.print(0);
                }
            }
            System.out.println();
        }
    }
}
